//
// Created by Apple on 2021/10/15.
//

# include "erroTest.h"
# include "RtspTest.h"
# include <cassert>
# include <iostream>

void ErrorCodeTest()
{
    std::error_code ec = twt::FlightsErrc::NoFlightsFound;
    assert (ec);
    assert (ec == twt::FlightsErrc::NoFlightsFound);
    assert (ec != twt::FlightsErrc::InvertedDates);
    std::cout << ec << std::endl;
}

int main ()
{
    bool result = false;
    std::string rtspUrl1 = "rtsp://192.168.1.1/stream1";
    result = ISValiedRtspUrl(rtspUrl1);
    std::cout << "rtspUrl1 test result: " << result << std::endl;

    std::string rtspUrl2 = "rtsp://192.168.1.1:554/stream1";
    result = ISValiedRtspUrl(rtspUrl2);
    std::cout << "rtspUrl2 test result: " << result << std::endl;

    std::string rtspUrl3 = "rtsp://192.168.1.1:1234/stream1";
    result = ISValiedRtspUrl(rtspUrl3);
    std::cout << "rtspUrl3 test result: " << result << std::endl;

    std::string rtspUrl4 = "rtsp://192.168.1.1:12345/stream1";
    result = ISValiedRtspUrl(rtspUrl4);
    std::cout << "rtspUrl4 test result: " << result << std::endl;

    std::string rtspUrl5 = "rtsp://192.168.1.1:123456/stream1";
    result = ISValiedRtspUrl(rtspUrl5);
    std::cout << "rtspUrl5 test result: " << result << std::endl;

    std::string rtspUrl6 = "rtsp://192.168.1:123456/stream1";
    result = ISValiedRtspUrl(rtspUrl6);
    std::cout << "rtspUrl6 test result: " << result << std::endl;

    std::string rtspUrl7 = "123rtsp://192.168.1.1:123456/stream1";
    result = ISValiedRtspUrl(rtspUrl7);
    std::cout << "rtspUrl7 test result: " << result << std::endl;

    std::cout << "=====with user====" << std::endl;
    std::string rtspUrl8 = "rtsp://admin@192.168.1:12345/stream1";
    result = ISValiedRtspUrl(rtspUrl8);
    std::cout << "rtspUrl8 test result: " << result << std::endl;

    std::string rtspUrl9 = "rtsp://admin:@192.168.1:12345/stream1";
    result = ISValiedRtspUrl(rtspUrl9);
    std::cout << "rtspUrl9 test result: " << result << std::endl;

    std::string rtspUrl10 = "rtsp://admin123456789adminadmin1234567:admin123@192.168.1:12345/stream1";
    result = ISValiedRtspUrl(rtspUrl10);
    std::cout << "rtspUrl10 test result: " << result << std::endl;

    return 0;

}